home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Peter Lewis / PNL Libraries / Assembly / StubGestalt.a < prev    next >
Encoding:
Text File  |  1994-08-04  |  634 b   |  43 lines  |  [TEXT/MPS ]

  1.     macro
  2.     PUSH
  3.     move.l    &SYSLIST[1],-(sp)
  4.     endm
  5.         
  6.     macro
  7.     POP
  8.     move.l    (sp)+,&SYSLIST[1]
  9.     endm
  10.  
  11. CallStack    record    0
  12. Return        ds.l    1
  13. respp        ds.l    1
  14. selector    ds.l    1
  15. ret        ds.w    1
  16.         endr
  17.  
  18. ; function StubGestalt(selector:OSType; var response:longInt):OSErr;
  19. StubGestalt    proc    export
  20.     with    CallStack
  21.     
  22.     lea    storage,a0
  23.     move.l    a0,d0
  24.     move.l    respp(sp),a0
  25.     move.l    d0,(a0)
  26.     clr.w    ret(sp)
  27.  
  28.     move.l    Return(sp),a0
  29.     add    #12,sp
  30.     jmp    (a0)
  31.     
  32. storage    dc.l    0
  33.  
  34.     endp
  35.     
  36.     END
  37.  
  38. asm -wb "{active}"
  39. (evaluate "{active}" =~ /(?*):(?*)®1.a/ )> dev:null
  40. (evaluate "{active}" =~ "/(?*)®2.a/" )> dev:null
  41. link -sn StubGestalt="{®1}" "{active}.o" -o "{®2}"
  42. dumpcode "{®2}"
  43.